// ContentType of attachment

#ifndef _KC_CONTENTTYPE_H__KC_
#define _KC_CONTENTTYPE_H__KC_

#include <string>
#include <iostream>
#include <map>

namespace kc_sf
{
	class ContentType
	{
		public:

			ContentType (
					const std::string &_type,
					const std::string &_subtype,
					const std::string &parameters_string = "" );

			bool operator == (const ContentType &ct) const;
			bool operator != (const ContentType &ct) const;

			bool isBodyText() const;

			const std::string & getType() const { return ct_type; }
			const std::string & getSubtype() const { return ct_subtype; }

			void extractParameters( const std::string &param_unparsed_string );
			std::string getParameter( const std::string &name ) const;

			std::string toString() const;

			friend std::ostream &
			operator << (std::ostream &out, const ContentType &ct);

		private:

			std::string ct_type;
			std::string ct_subtype;

			typedef std::map<std::string, std::string> ParameterMap;
			ParameterMap ct_parameters;
	};
}

#endif // _KC_CONTENTTYPE_H__KC_
